package zhxt.helmet.dao;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import zhxt.helmet.pojo.*;

import java.util.List;

@Repository
public interface PopedomDao {

    //获取全部省
    @Select("select * from province")
    public List<Province> selectAllProvinces();
    //根据省id获取全部市
    @Select("select * from city where province_id=#{id}")
    @Results({
            @Result(column = "province_id", property = "provinceId")
    })
    public List<City> selectCitiesByProvinceId(int id);
    //根据市id获取全部区
    @Select("select * from district where city_id=#{id}")
    public List<District> selectDistrictsByCityId(int id);
    //根据区id获取全部块
    @Select("select * from block where district_id=#{id}")
    public List<Block> selectBlocksByDistrictId(int id);
}
